//
//  NetworkTool.h
//  测试
//
//  Created by Gollum on 16/9/1.
//  Copyright © 2016年 Gollum. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef void(^successBlock)(id result);
typedef void(^failureBlock)(NSError *error);

typedef NS_ENUM(NSUInteger, JHResponseStyle) {
    JHJSON,
    JHDATA,
    JHXML,
};

typedef NS_ENUM(NSUInteger, JHRequestStyle) {
    JHBodyString,
    JHBodyJSON,
};
@interface NetworkTool : NSObject
+(void)GET:(NSString *)url
   andBody:(id)body
 andHeader:(NSDictionary *)headers
andResponse:(JHResponseStyle)responseStyle
andSuccessBlock:(successBlock)success
andFailureBlock:(failureBlock)failure;

+(void)POST:(NSString *)url
    andBody:(id)body
andBodyStyle:(JHRequestStyle)bodyStyle
  andHeader:(NSDictionary *)headers
andResponse:(JHResponseStyle)responseStyle
andSuccessBlock:(successBlock)success
andFailureBlock:(failureBlock)failure;

@end
